package com.exam.master.model.main.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.exam.commonbiz.bean.MessageInfo;
import com.exam.master.R;

public class MessageDetailAdapter extends BaseQuickAdapter<MessageInfo, BaseViewHolder> {

    public MessageDetailAdapter() {
        super(R.layout.item_layout_message_detail, null);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageInfo item) {

        helper.getView(R.id.ll_left).setVisibility(View.GONE);
        helper.getView(R.id.ll_right).setVisibility(View.GONE);
        if (item.isSelf == 1) {
            helper.setText(R.id.tv_content_right, item.content);
            helper.getView(R.id.ll_right).setVisibility(View.VISIBLE);
        } else {
            helper.setText(R.id.tv_content_left, item.content);
            helper.getView(R.id.ll_left).setVisibility(View.VISIBLE);
        }

    }
}
